package com.jd.sunny.java.multithreading.concurrent.threadpool;

/**
 * @Description:Excutors
 * @author:sunny
 * @since:2012-12-25 15:30
 * @version:1.0.0
 */

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;

/**
 *1.java.util.concurrent.Executors
 *2.Executors extends Object
 *3.Factory and utility methods for Executor,so it is a util class 
 *
 */
public class ExcutorsTest {

    public static void main(String[] args){

        //Creates a thread pool that reuses a fixed number of threads
        ExecutorService executorService =  Executors.newFixedThreadPool(5);

        //Creates a thread pool that can schedule commands to run after a
        //given delay, or to execute periodically.
        ScheduledExecutorService scheduledExecutorService =  Executors.newScheduledThreadPool(1);

    }

}
